package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AppUserHistoryMapper;
import com.ruoyi.system.domain.xcx.AppUserHistory;
import com.ruoyi.system.service.IAppUserHistoryService;

/**
 * 用户流水Service业务层处理
 *
 * @author ruoyi
 * @date 2024-08-21
 */
@Service
public class AppUserHistoryServiceImpl implements IAppUserHistoryService
{
    @Autowired
    private AppUserHistoryMapper appUserHistoryMapper;

    /**
     * 查询用户流水
     *
     * @param id 用户流水主键
     * @return 用户流水
     */
    @Override
    public AppUserHistory selectAppUserHistoryById(Long id)
    {
        return appUserHistoryMapper.selectAppUserHistoryById(id);
    }

    /**
     * 查询用户流水列表
     *
     * @param appUserHistory 用户流水
     * @return 用户流水
     */
    @Override
    public List<AppUserHistory> selectAppUserHistoryList(AppUserHistory appUserHistory)
    {
        return appUserHistoryMapper.selectAppUserHistoryList(appUserHistory);
    }

    /**
     * 新增用户流水
     *
     * @param appUserHistory 用户流水
     * @return 结果
     */
    @Override
    public int insertAppUserHistory(AppUserHistory appUserHistory)
    {
        appUserHistory.setCreateTime(DateUtils.getNowDate());
        return appUserHistoryMapper.insertAppUserHistory(appUserHistory);
    }

    /**
     * 修改用户流水
     *
     * @param appUserHistory 用户流水
     * @return 结果
     */
    @Override
    public int updateAppUserHistory(AppUserHistory appUserHistory)
    {
        return appUserHistoryMapper.updateAppUserHistory(appUserHistory);
    }

    /**
     * 批量删除用户流水
     *
     * @param ids 需要删除的用户流水主键
     * @return 结果
     */
    @Override
    public int deleteAppUserHistoryByIds(Long[] ids)
    {
        return appUserHistoryMapper.deleteAppUserHistoryByIds(ids);
    }

    /**
     * 删除用户流水信息
     *
     * @param id 用户流水主键
     * @return 结果
     */
    @Override
    public int deleteAppUserHistoryById(Long id)
    {
        return appUserHistoryMapper.deleteAppUserHistoryById(id);
    }

    @Override
    public List<AppUserHistory> selectAppUserFatherIdHistoryList(AppUserHistory appUserHistory) {

        return appUserHistoryMapper.selectAppUserFatherIdHistoryList(appUserHistory);
    }
}
